Skip to content

Conversation

@CIGbalance
Copy link
Collaborator

@CIGbalance CIGbalance commented Oct 16, 2025

Added a preliminary script for checking consistency, along with a README detailing the envisioned github workflow.

Main question for review: Should I be checking for anything else? Is there anything that is too strict?

Closes #123

"textual description",
]

UNIQUE_FIELDS = ["name", "reference", "implementation"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This triggers an error when:

  • reference is '' (empty), which is probably not what we want. Thinking about it: A reference can also introduce multiple problems, so does not need to be unique in any case? What do you think?
  • Similarly, I expect the same happens for the implementation field, which may also not need to be unique, because a single package may implement multiple problems/benchmarks. (I guess it might depend a bit on how specific we want the reference to the implementation to be, but it probably cannot always be specific enough to be unique.)

import sys

# Define the required fields your YAML must have
REQUIRED_FIELDS = [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have the same list of fields in yaml_to_html.py (called default_columns). We should probably maintain it in a single place, and/or let one inherit the other?



def check_fields(data):
if len(data) != len(REQUIRED_FIELDS):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should test that there are at least this many fields. I would explicitly want people to add new fields for interesting properties we do not collect yet. Then:

  • Properties not in the REQUIRED_FIELDS should then be checked against a (to be created) NOT_REQUIRED_FIELDS which would contain all other fields (might be empty for now).
  • A message should be returned listing the new fields (found in neither the required or not-required lists), to be verified by an OPL maintainer as actually new (not just a new name for an existing property), and then either added to the not required list or fixed (or requested as change on a PR) to have the correct existing name.
  • Ideally all other checks are still done before such a list is returned, so we know everything else already passes the checks, and verifying new fields (or maybe other similar things) is all that needs to be done.

@kvdblom
Copy link
Collaborator

kvdblom commented Nov 20, 2025

Something else that came to mind that I did not think about or try yesterday:

  • What happens if multiple new problems/benchmarks are added at the same time (in a single yaml file)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement the consistency check for new problems to be run on the PRs

3 participants